package main

import (
	"fmt"
	"sync"
)

var c4 chan struct{}
var c5 chan struct{}

func printNum(group *sync.WaitGroup) {

	defer group.Done()
	for i := 1; i < 11; i++ {
		<-c4
		fmt.Println(i)
		c5 <- struct{}{}

	}
	return
}

func printA(group *sync.WaitGroup) {

	defer group.Done()
	s := "abcdefghij"

	for _, v := range s {
		<-c5
		fmt.Println(string(v))
		c4 <- struct{}{}

	}
	return
}
func main() {

	var wg sync.WaitGroup
	c4 = make(chan struct{}, 1)
	c5 = make(chan struct{}, 1)
	wg.Add(2)
	c4 <- struct{}{}
	go printNum(&wg)
	go printA(&wg)
	wg.Wait()
}
